package com.outfood.api.controller;


import com.outfood.common.common.CurrentUser;
import com.outfood.common.common.replay.ReplyCode;
import com.outfood.common.common.response.RestResponse;
import com.outfood.domain.EvaluateRecord;
import com.outfood.domain.Store;
import com.outfood.service.IEvaluateRecordSerivice;
import com.outfood.service.IStoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Api(value = "EvaluateRecordController" ,tags = {"自动回复评论相关操作类"})
@RequestMapping("/api/evaluate")
public class EvaluateRecordController {

    @Resource
    IStoreService storeService;
    @ApiOperation("设置回评权限")
    @GetMapping("evaluateSet")
    public RestResponse evaluateSet(@ApiParam("门店ID")@RequestParam Long storeId, String  autoReplay){
        Store store = new Store();
        store.setId(storeId);
        store.setAutoReplay(autoReplay);
        storeService.update(storeId,store, CurrentUser.getUserId()+"");
        return new RestResponse<>(ReplyCode.SYS.SUCCESS,"操作成功");

    }
}
